.class public Lcom/waiqin365/h5/photo/WqPhotoClip;
.super Lorg/apache/cordova/CordovaPlugin;


# static fields
.field public static final a:Ljava/lang/String;


# instance fields
.field private b:Lorg/apache/cordova/WqCordovaActivity;

.field private c:Lorg/apache/cordova/CallbackContext;

.field private d:Lcom/waiqin365/lightapp/view/a;


# direct methods
.method static constructor <clinit>()V
    .locals 4

    const-string/jumbo v0, "%s%s"

    const/4 v1, 0x2

    new-array v1, v1, [Ljava/lang/Object;

    const/4 v2, 0x0

    sget-object v3, Lcom/fiberhome/gaea/client/b/a/a;->g:Ljava/lang/String;

    aput-object v3, v1, v2

    const/4 v2, 0x1

    const-string/jumbo v3, "cuslogin_mydata_h5_clip"

    aput-object v3, v1, v2

    invoke-static {v0, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/waiqin365/h5/photo/WqPhotoClip;->a:Ljava/lang/String;

    return-void
.end method

.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Lorg/apache/cordova/CordovaPlugin;-><init>()V

    return-void
.end method

.method static synthetic a(Lcom/waiqin365/h5/photo/WqPhotoClip;)Lcom/waiqin365/lightapp/view/a;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/h5/photo/WqPhotoClip;->d:Lcom/waiqin365/lightapp/view/a;

    return-object v0
.end method

.method private a()V
    .locals 6

    const/4 v5, 0x0

    new-instance v0, Lcom/waiqin365/lightapp/view/a;

    iget-object v1, p0, Lcom/waiqin365/h5/photo/WqPhotoClip;->b:Lorg/apache/cordova/WqCordovaActivity;

    invoke-direct {v0, v1}, Lcom/waiqin365/lightapp/view/a;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/waiqin365/h5/photo/WqPhotoClip;->d:Lcom/waiqin365/lightapp/view/a;

    iget-object v0, p0, Lcom/waiqin365/h5/photo/WqPhotoClip;->d:Lcom/waiqin365/lightapp/view/a;

    const/4 v1, 0x2

    new-array v1, v1, [Ljava/lang/String;

    iget-object v2, p0, Lcom/waiqin365/h5/photo/WqPhotoClip;->b:Lorg/apache/cordova/WqCordovaActivity;

    const v3, 0x7f0802bb

    invoke-virtual {v2, v3}, Lorg/apache/cordova/WqCordovaActivity;->getString(I)Ljava/lang/String;

    move-result-object v2

    aput-object v2, v1, v5

    const/4 v2, 0x1

    iget-object v3, p0, Lcom/waiqin365/h5/photo/WqPhotoClip;->b:Lorg/apache/cordova/WqCordovaActivity;

    const v4, 0x7f0802ba

    invoke-virtual {v3, v4}, Lorg/apache/cordova/WqCordovaActivity;->getString(I)Ljava/lang/String;

    move-result-object v3

    aput-object v3, v1, v2

    new-instance v2, Lcom/waiqin365/h5/photo/c;

    invoke-direct {v2, p0}, Lcom/waiqin365/h5/photo/c;-><init>(Lcom/waiqin365/h5/photo/WqPhotoClip;)V

    invoke-virtual {v0, v1, v2}, Lcom/waiqin365/lightapp/view/a;->a([Ljava/lang/String;Lcom/waiqin365/lightapp/view/l;)V

    iget-object v0, p0, Lcom/waiqin365/h5/photo/WqPhotoClip;->d:Lcom/waiqin365/lightapp/view/a;

    iget-object v1, p0, Lcom/waiqin365/h5/photo/WqPhotoClip;->b:Lorg/apache/cordova/WqCordovaActivity;

    invoke-virtual {v1}, Lorg/apache/cordova/WqCordovaActivity;->getWindow()Landroid/view/Window;

    move-result-object v1

    invoke-virtual {v1}, Landroid/view/Window;->getDecorView()Landroid/view/View;

    move-result-object v1

    const/16 v2, 0x51

    invoke-virtual {v0, v1, v2, v5, v5}, Lcom/waiqin365/lightapp/view/a;->showAtLocation(Landroid/view/View;III)V

    return-void
.end method

.method static synthetic b(Lcom/waiqin365/h5/photo/WqPhotoClip;)Lorg/apache/cordova/WqCordovaActivity;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/h5/photo/WqPhotoClip;->b:Lorg/apache/cordova/WqCordovaActivity;

    return-object v0
.end method


# virtual methods
.method public execute(Ljava/lang/String;Lorg/apache/cordova/CordovaArgs;Lorg/apache/cordova/CallbackContext;)Z
    .locals 4

    const/4 v1, 0x0

    iget-object v0, p0, Lcom/waiqin365/h5/photo/WqPhotoClip;->cordova:Lorg/apache/cordova/CordovaInterface;

    invoke-interface {v0}, Lorg/apache/cordova/CordovaInterface;->getActivity()Landroid/app/Activity;

    move-result-object v0

    check-cast v0, Lorg/apache/cordova/WqCordovaActivity;

    iput-object v0, p0, Lcom/waiqin365/h5/photo/WqPhotoClip;->b:Lorg/apache/cordova/WqCordovaActivity;

    invoke-virtual {p2, v1}, Lorg/apache/cordova/CordovaArgs;->isNull(I)Z

    move-result v0

    if-nez v0, :cond_1

    invoke-virtual {p2, v1}, Lorg/apache/cordova/CordovaArgs;->getString(I)Ljava/lang/String;

    move-result-object v2

    :try_start_0
    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0, v2}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    const-string/jumbo v3, "width"

    invoke-virtual {v0, v3}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_0

    const-string/jumbo v3, "width"

    invoke-virtual {v0, v3}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v0

    iget-object v3, p0, Lcom/waiqin365/h5/photo/WqPhotoClip;->b:Lorg/apache/cordova/WqCordovaActivity;

    iput v0, v3, Lorg/apache/cordova/WqCordovaActivity;->clipWidth:I
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_1

    :cond_0
    :goto_0
    :try_start_1
    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0, v2}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    const-string/jumbo v2, "hight"

    invoke-virtual {v0, v2}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_1

    const-string/jumbo v2, "hight"

    invoke-virtual {v0, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v0

    iget-object v2, p0, Lcom/waiqin365/h5/photo/WqPhotoClip;->b:Lorg/apache/cordova/WqCordovaActivity;

    iput v0, v2, Lorg/apache/cordova/WqCordovaActivity;->clipHight:I
    :try_end_1
    .catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_2
    .catch Ljava/lang/NumberFormatException; {:try_start_1 .. :try_end_1} :catch_3

    :cond_1
    :goto_1
    iput-object p3, p0, Lcom/waiqin365/h5/photo/WqPhotoClip;->c:Lorg/apache/cordova/CallbackContext;

    iget-object v0, p0, Lcom/waiqin365/h5/photo/WqPhotoClip;->b:Lorg/apache/cordova/WqCordovaActivity;

    iput-object p3, v0, Lorg/apache/cordova/WqCordovaActivity;->callbackContextClip:Lorg/apache/cordova/CallbackContext;

    invoke-static {}, Landroid/os/Environment;->getExternalStorageState()Ljava/lang/String;

    move-result-object v0

    const-string/jumbo v2, "mounted"

    invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_2

    iget-object v0, p0, Lcom/waiqin365/h5/photo/WqPhotoClip;->b:Lorg/apache/cordova/WqCordovaActivity;

    const v2, 0x7f0806b8

    invoke-virtual {v0, v2}, Lorg/apache/cordova/WqCordovaActivity;->getString(I)Ljava/lang/String;

    move-result-object v0

    iget-object v2, p0, Lcom/waiqin365/h5/photo/WqPhotoClip;->b:Lorg/apache/cordova/WqCordovaActivity;

    invoke-static {v2, v0}, Lcom/waiqin365/lightapp/view/dk;->a(Landroid/content/Context;Ljava/lang/CharSequence;)V

    move v0, v1

    :goto_2
    return v0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_0

    :catch_1
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/NumberFormatException;->printStackTrace()V

    goto :goto_0

    :catch_2
    move-exception v0

    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_1

    :catch_3
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/NumberFormatException;->printStackTrace()V

    goto :goto_1

    :cond_2
    invoke-direct {p0}, Lcom/waiqin365/h5/photo/WqPhotoClip;->a()V

    const/4 v0, 0x1

    goto :goto_2
.end method
